package com.wd.jetpack

import android.app.Application
import com.wd.base.component.IAppComponent
import com.wd.base.config.Constance
import com.wd.base.router.ARouter
import com.wd.base.util.Logger

/**
 * NA<BR>
 *
 * @author w4425
 * @version [V2.0.0, 2021/6/1]
 * @since V2.0.0
 */
class JpApp : Application(), IAppComponent {
    override fun onCreate() {
        super.onCreate()
        instance = this
    }

    override fun initialize(app: Application?) {
        Logger.d("initialize start")
        ARouter.getInstance().addActivity(Constance.MODULE_URL_TAB_JETPACK, TabMainActivity::class.java)
    }

    companion object {
        var instance: Application? = null
        fun instance() = instance ?: throw Throwable("instance 还未初始化")
    }
}